<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<button id="btn">按钮事件</button>
		<input id="file" type="file" name="" id="" />
		<script src="./node_modules/axios/dist/axios.js"></script>
		<script>
			// form-data 数据结构
			file.onchange = function (file) {
				console.log('file:', file.target.files)
				axios
					.post('http://localhost:8888/api/ocr', {
						file: '测试数据'
					})
					.then((res) => {
						console.log('res:', res)
					})
			}

			btn.onclick = function () {
				axios.get('http://localhost:8888/api/test').then((res) => {
					console.log('res:', res)
				})
			}
		</script>
	</body>
</html>
